Do not check whether the path is a folder. It is useful to bookmark files
authorFederico Mena Quintero <federico@ximian.com>
Fri, 11 Nov 2005 22:29:09 +0000 (22:29 +0000)
committerFederico Mena Quintero <federico@src.gnome.org>
Fri, 11 Nov 2005 22:29:09 +0000 (22:29 +0000)
2005-11-11  Federico Mena Quintero  <federico@ximian.com>

* gtk/gtkfilechooserdefault.c (shortcuts_insert_path): Do not
check whether the path is a folder.  It is useful to bookmark
files as well (e.g. todo.txt), and this will also help
performance.
(shortcuts_add_bookmark_from_path): Likewise.
(shortcuts_activate_iter): Change folders or select files, as
appropriate.

ChangeLog
ChangeLog.pre-2-10
gtk/gtkfilechooserdefault.c

index c1c06416f095ca9acc5ab0bc8f1e6d86268bd0d6..34f7f4d15c3e9befd666dd694f5323f4c1855173 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-11-11  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_insert_path): Do not
+       check whether the path is a folder.  It is useful to bookmark
+       files as well (e.g. todo.txt), and this will also help
+       performance.
+       (shortcuts_add_bookmark_from_path): Likewise.
+       (shortcuts_activate_iter): Change folders or select files, as
+       appropriate.
+
 2005-11-11  Federico Mena Quintero  <federico@ximian.com>
 
        * tests/autotestfilechooser.c (main): Use
index c1c06416f095ca9acc5ab0bc8f1e6d86268bd0d6..34f7f4d15c3e9befd666dd694f5323f4c1855173 100644 (file)
@@ -1,3 +1,13 @@
+2005-11-11  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_insert_path): Do not
+       check whether the path is a folder.  It is useful to bookmark
+       files as well (e.g. todo.txt), and this will also help
+       performance.
+       (shortcuts_add_bookmark_from_path): Likewise.
+       (shortcuts_activate_iter): Change folders or select files, as
+       appropriate.
+
 2005-11-11  Federico Mena Quintero  <federico@ximian.com>
 
        * tests/autotestfilechooser.c (main): Use
index 998a6eb99bacc8738942a8239fd91e56d7d54b77..0fcf7967dc6329fffb86b57b0a712692c6fc8546 100644 (file)
@@ -1275,12 +1275,6 @@ shortcuts_insert_path (GtkFileChooserDefault *impl,
     }
   else
     {
-      if (!check_is_folder (impl->file_system, path, error))
-       {
-         profile_end ("end - is not folder", NULL);
-         return FALSE;
-       }
-
       if (label)
        label_copy = g_strdup (label);
       else
@@ -2035,14 +2029,6 @@ shortcuts_add_bookmark_from_path (GtkFileChooserDefault *impl,
   if (shortcut_find_position (impl, path) != -1)
     return FALSE;
 
-  /* FIXME: this check really belongs in gtk_file_system_insert_bookmark.  */
-  error = NULL;
-  if (!check_is_folder (impl->file_system, path, &error))
-    {
-      error_adding_bookmark_dialog (impl, path, error);
-      return FALSE;
-    }
-
   error = NULL;
   if (!gtk_file_system_insert_bookmark (impl->file_system, path, pos, &error))
     {
@@ -6759,7 +6745,10 @@ shortcuts_activate_iter (GtkFileChooserDefault *impl,
       const GtkFilePath *file_path;
 
       file_path = col_data;
-      change_folder_and_display_error (impl, file_path);
+      if (check_is_folder (impl->file_system, file_path, NULL))
+       change_folder_and_display_error (impl, file_path);
+      else
+       gtk_file_chooser_default_select_path (GTK_FILE_CHOOSER (impl), file_path, NULL);
     }
 }